package com.train.classeval.service.impl;

import com.train.classeval.entity.Role;
import com.train.classeval.entity.User;
import com.train.classeval.mapper.RoleMapper;
import com.train.classeval.service.IRoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author xs
 * @since 2021-10-08
 */
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IRoleService {


    @Autowired
    private RoleMapper roleMapper;

    /**
     * 添加权限业务实现
     * @param uid
     * @param rid
     * @return
     */
    @Override
    public int addRole(Integer uid, Integer rid) {
        final int i = roleMapper.addRole(uid, rid);
        return i;
    }
    /**
     * 查看用户的角色
     * @param uid
     * @param rid
     * @return
     */
    @Override
    public int selectUserRole(Integer uid, Integer rid) {
        final int i = roleMapper.selectUserRole(uid, rid);
        return i;
    }
}
